package com.yipinhouse.backstage.client;

import com.yipinhouse.backstage.client.param.AddBrokerWebParam;
import com.yipinhouse.backstage.client.param.OrderHouseWebParam;
import com.yipinhouse.common.result.Result;
import com.yipinhouse.employee.client.param.AddBrokerParam;
import com.yipinhouse.employee.client.param.OrderHouseParam;
import com.yipinhouse.employee.client.result.ShopBrokerInfoResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@FeignClient(contextId = "brokerInfoManageBackClient",name="backstage",path = "backstage")
public interface BrokerInfoWebManageClient {

    /**
     * 员工绑定门店
     * @param shopId
     * @param brokerId
     * @return
     */
    @GetMapping("correlation")
    public Result correlation(@RequestParam("shopId") Integer shopId,
                              @RequestParam("brokerId") Integer brokerId);

    /**
     * 升职：将员工升职为店长
     * @param brokerId
     * @return
     */
    @GetMapping("promotion")
    public Result promotion(@RequestParam("brokerId") Integer brokerId,
                            @RequestParam("shopId") Integer shopId);


    /**
     * 添加员工
     * @param param
     * @return
     */
    @PostMapping("addBroker")
    public Result addBroker(@RequestBody AddBrokerWebParam param);

    /**
     * 经纪人锁定房源
     * @param
     * @return
     */
    @PutMapping("/orderHouse")
    Result orderHouse(@RequestBody OrderHouseWebParam param);


    /**
     * 查询门店员工
     *
     * @param shopId
     * @return
     */
    @GetMapping("getBrokerByShopId")
    Result<List<ShopBrokerInfoResult>> getBrokerByShopId(Integer shopId);
}
